/*
 *  ptclSendData.h
 *  serialExample
 *
 *  Created by Motoi Ishibashi on 11/02/27.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef _PTCLT_SEND_DATA_H
#define _PTCLT_SEND_DATA_H

#include "ofMain.h"
#include "ofThread.h"
#define PIXELSIZE 200
#define PIXELSUBSIZE 40
#define CHECKPOINTNUM 16
#define PIXELSUMNUM 5

class ptclSendData : public ofThread {
public:
	ptclSendData();
	~ptclSendData();
	
	void setup(ofSerial* s){
		serial = s;
	}
	
	void threadedFunction();
	void updateData(unsigned char* d);
	void passInColorAlternatedPixels(unsigned char * _pixels);
	void startSend();
	void stopSend();
	void sendMaxColor(int tgtID, unsigned char r, unsigned char g, unsigned char b);
	unsigned char * colorlAlternatedPixels;
	static const int w = PIXELSIZE;
	static const int h = CHECKPOINTNUM;
	
private:
	ofSerial* serial;
	unsigned char* pixelBuff;
	unsigned char* pixelSubBuff;
	bool bLoop;
};

#endif

